package com.passioneffect.components {
	import flash.display.MovieClip;
	
	import com.passioneffect.display.Component;
	import com.passioneffect.layout.ImageScrollerLayout;
	import com.passioneffect.layout.Layout;
	import com.passioneffect.layoutflow.SimpleLayoutFlow;
	import com.passioneffect.parser.ListXMLParser;
	import com.passioneffect.parser.ValuePairParser;
	import com.passioneffect.widgets.CirclePreloader;
	
	import Boolean;
	import Number;	

	/**
	 * @author Passion Effect
	 */
	public class ImageScroller extends FlowEffect {
		private var mc:MovieClip;
		
		[Inspectable(type=Number,defaultValue="100")]
		public var thumbnailWidth:Number=100;
		
		[Inspectable(type=Number,defaultValue="100")]
		public var thumbnailHeight:Number=100;
		
		private var _scrollEndPercent:Number=0.2;
		
		[Inspectable(type=Number,defualtValue="0.5")]
		public var mouseOverDarken:Number=0.5;
		
		[Inspectable(type=Boolean,defaultValue="true")]
		public var mouseOverBorder:Boolean=true;
		
		[Inspectable(type=Color,defaultValue="#CA91D9")]
		public var mouseOverBorderColor:Number=0xCA91D9;
		
		[Inspectable(type=Number,defaultValue="1")]
		public var mouseOverSaturation:Number=1;
		
		public function ImageScroller(parentComponent : Component = null) {
			super(parentComponent);
		}
		
		override protected function preset() : void {
			_contentClass="ScrollerContentMC";
			_direction = "horizontal";
			_scrollType="none";
			_mask=true;
			_layout = new ImageScrollerLayout(this);
			startUpMotion = false;
			_layout.scrollEndPercent=this.scrollEndPercent;
			
			layoutFlow = new SimpleLayoutFlow();
			xmlParser = new ListXMLParser();
			styleXMLParser = new ValuePairParser();
		}
		
		override protected function postset():void{
			scrollType="fastScroll";
		}
		
		public function get spacing():Number{
			return __spacing;
		}
		
		public function set spacing(n:Number):void{
			__spacing=n;
		}
		
		[Inspectable(type=Number,defaultValue=1)]
		public function get scrollTime():Number{
			return _scrollTime;
		}
		
		public function set scrollTime(time:Number):void{
			_scrollTime=time;
		}
		
		[Inspectable(type=Number,defaultValue="0.2")]
		public function set scrollEndPercent(scrollEndPercent : Number) : void {
			_scrollEndPercent = scrollEndPercent;
			if(layout)layout.scrollEndPercent=0.2;
		}

		public function get scrollEndPercent() : Number {
			return _scrollEndPercent;
		}
	}
}
